import request from '@/utils/request'
import download from "@/utils/downloader.js";

//试题分页列表
export function topicList(data) {
	return request({
		url: '/teacher/topic/topicList',
		method: 'get',
		params: data
	})
}
//新增试题
export function saveTopic(data) {
	return request({
		url: '/teacher/topic/saveTopic',
		method: 'post',
		data
	})
}
//更新试题
export function updateTopic(data) {
	return request({
		url: '/teacher/topic/updateTopic',
		method: 'post',
		data
	})
}
//删除试题
export function removeTopic(data) {
	return request({
		url: '/teacher/topic/removeTopic',
		method: 'delete',
		params: data
	})
}
//查询试题详情
export function selectTopicDetail(data) {
	return request({
		url: '/teacher/topic/selectTopicDetail',
		method: 'get',
		params: data
	})
}

//试题导出(默认导出用户创建所有试题)	
export function topicExport(data) {
	return download({
		url: '/teacher/topic/topicExport',
		method: 'get',
		params: data
	})
}

//试题分页列表（题库选择）
export function selectTopicList(data) {
	return request({
		url: '/teacher/topic/selectTopicList',
		method: 'get',
		params: data
	})
}

//查询题库数量
export function selectQuestionCountByType(data) {
	return request({
		url: '/teacher/topic/selectQuestionCountByType',
		method: 'get',
		params: data
	})
}
//Excel导入试题
export function importTopic(data) {
	return request({
		url: '/teacher/topic/importTopic',
		method: 'post',
		data
	})
}
//Excel模板下载
export function downloadTemplate(data) {
	return download({
		url: '/teacher/topic/downloadTemplate',
		method: 'get',
		params: data
	})
}

